import request from '@/utils/request'

// 查询跑步成绩列表
export function listResults(query) {
  return request({
    url: '/iot/results/list',
    method: 'get',
    params: query
  })
}

// 查询跑步成绩详细
export function getResults(id) {
  return request({
    url: '/iot/results/' + id,
    method: 'get'
  })
}

// 新增跑步成绩
export function addResults(data) {
  return request({
    url: '/iot/results',
    method: 'post',
    data: data
  })
}

// 修改跑步成绩
export function updateResults(data) {
  return request({
    url: '/iot/results',
    method: 'put',
    data: data
  })
}

// 删除跑步成绩
export function delResults(id) {
  return request({
    url: '/iot/results/' + id,
    method: 'delete'
  })
}

export function getRanking(id) {
  return request({
    url: '/iot/results/ranking',
    method: 'get'
  })
}
